package com.itheima.stock.service.imp;

import com.itheima.stock.common.domian.StockOuterMarketDomin;
import com.itheima.stock.config.StockInfoConfig;
import com.itheima.stock.mapper.StockOuterMarketIndexInfoMapper;
import com.itheima.stock.service.StockOutMarketService;
import com.itheima.stock.vo.code.ResponseCode;
import com.itheima.stock.vo.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: siwukun
 * @date: 2022/06/04
 * @description:
 */
@Service
public class StockOutMarketServiceImpl implements StockOutMarketService {
    /**
     * 查询外盘所有数据
     *
     * @return
     */
    @Autowired
    private StockOuterMarketIndexInfoMapper stockOuterMarketIndexInfoMapper;

    @Override
    public R<List<StockOuterMarketDomin>> queryAllStockOutMarket() {

        List<StockOuterMarketDomin>  list = stockOuterMarketIndexInfoMapper.queryAllStockOutMarket();
        if (list==null){
            return R.error(ResponseCode.NO_RESPONSE_DATA.getMessage());
        }
        return R.ok(list);
    }
}
